// Lock.h: interface for the Lock class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LOCK_H__9EBC70E3_28F4_4D58_BDF1_E703D611B412__INCLUDED_)
#define AFX_LOCK_H__9EBC70E3_28F4_4D58_BDF1_E703D611B412__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class Lock
{
public:
    // Acquire the state of the semaphore
    Lock ( Mutex & mutex )
        : _mutex(mutex)
    {
        _mutex.Acquire();
    }
    // Release the state of the semaphore
    ~Lock ()
    {
        _mutex.Release();
    }
private:
    Mutex & _mutex;
};

#endif // !defined(AFX_LOCK_H__9EBC70E3_28F4_4D58_BDF1_E703D611B412__INCLUDED_)
